# -*- coding: utf-8 -*-
##############################################################################
#
#    OpenERP, Open Source Management Solution
#    Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as
#    published by the Free Software Foundation, either version 3 of the
#    License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Affero General Public License for more details.
#
#    You should have received a copy of the GNU Affero General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

{
    'name': 'one2many_search',
    'version': '0.1',
    'description': """
        ## one2many搜索扩展
        ```
            <field name='line_ids'
                widget="one2many_search_bar"
                options="{
                    'search_filter': 'product_id.default_code name',
                    'buttons': [{
                        'string': '批量上架',
                        'action': 'do_online'
                        },
                        {
                            'string': '批量下架',
                            'action': 'do_offline'
                        }]}"
            />
        ```
        在one2many字段中使用widget来使用，用options来指定参数，其中
        - search_filter：指定搜索框用的字段，多个字段之间使用空格分隔
            > product_id.default_code name 会被解析会
            ```
            ['|', ('product_id.default_code','ilike', self), ('name', 'ilike', self)]
            ```
        - buttons: 用来指定批量操作的时候显示的按钮，其中，string 表示按钮的名称，action 为实际调用的后台 python 函数
    """,
    'author': 'zhengXiang',
    'depends': ['web'],
    'data': [
        'views/need.xml',
    ],
    'qweb': [
        'static/src/xml/*.xml'
    ],
}
